package com.itheima.date;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @program: itheima-jdk8
 * @description:
 * @author: zhanghz001
 * @create: 2021-01-10 10:44
 **/
public class DateTimeFormatterDemo1 {
    private static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
    
    public static void main(String[] args) {
        ExecutorService pool = Executors.newFixedThreadPool(100);
        for (int i = 0; i < 30; i++) {
            pool.submit(() -> {
                LocalDate now = LocalDate.now();
                String format = formatter.format(now);
                System.out.println(format);
                LocalDate parse = LocalDate.parse(format, formatter);
                System.out.println(parse);
            });
        }
        pool.shutdown();
    }
}
